package com.cheng.im.common.entity;

import com.cheng.im.common.bean.msg.ProtoMsgV1;
import com.cheng.im.common.entity.ImNode;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;


/**
 * 远程会话缓存，是用户缓存的一部分
 * @author Cheng
 */
@Data
public class SessionCache implements Serializable
{
    private static final long serialVersionUID = -403010884211394856L;

    //用户的id
    private String userId;
    //session id
    private String sessionId;

    private String imei;

    private Integer clientType;

    private ProtoMsgV1.PlatformType platformType;
    //节点信息
    private ImNode imNode;

    public SessionCache()
    {
        userId = "";
        sessionId = "";
        imNode = new ImNode("unKnown", 0);
    }

    public SessionCache(
            String sessionId, String userId, ImNode imNode, ProtoMsgV1.PlatformType platformType)
    {
        this.sessionId = sessionId;
        this.userId = userId;
        this.imNode = imNode;
        this.platformType = platformType;
    }
}
